<!DOCTYPE html>
<html>

<head>

    {include file="common:meta"}

</head>
<style>
</style>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">

    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">

                <div class="ibox-content">
                    <form method="" class="form-horizontal" id="form" action="">
                        <input type="hidden" name="id" value="{$goldInfo['id']}">

                        <div class="form-group">
                            <label class="col-sm-2 control-label">
                                <span class="c-red">*</span>开始时间：
                            </label>
                            <div class="col-md-2 col-sm-10">
                                <label><input type="text" class="form-control date-search"  name="start" value="{$goldInfo['start']}"></label>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">
                                <span class="c-red">*</span>结束时间：
                            </label>
                            <div class="col-md-2 col-sm-10">
                                <label><input type="text" class="form-control date-search"  name="end" value="{$goldInfo['end']}"></label>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">
                                <span class="c-red">*</span>模式一奖池比例：
                            </label>
                            <div class="col-md-1 col-sm-5">
                                <label><input type="text" class="form-control"  name="one_pool" value="{$goldInfo['prize_pool'][1]}" placeholder="请填写小数形式"></label>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">
                                <span class="c-red">*</span>模式二奖池比例：
                            </label>
                            <div class="col-md-1 col-sm-5">
                                <label><input type="text" class="form-control"  name="two_pool" value="{$goldInfo['prize_pool'][2]}" placeholder="请填写小数形式"></label>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label" >
                                <span class="c-red">*</span>切换模式：
                            </label>
                            <div class="col-md-2 col-sm-10">
                                <div class="radio i-checks">
                                    {if ( $goldInfo.mode_type == 1) }
                                    <label><input type="radio"  name="mode_type" value="1" checked> <i></i>模式一</label>
                                    <label><input type="radio" name="mode_type"  value="2"> <i></i>模式二</label>
                                    {else /}
                                    <label><input type="radio"  name="mode_type" value="1" > <i></i>模式一</label>
                                    <label><input type="radio" name="mode_type"  value="2" checked> <i></i>模式二</label>
                                    {/if}
                                </div>
                            </div>
                        </div>
                        <div class="form-group has-success">
                            <div class="col-sm-4 col-sm-offset-2">
                                <input class="btn btn-primary" id="btn-submit" type="button" value="提交">
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="common:footer"}
<script>
    $('#btn-submit').click(function(){
        $.ajax({
            type:'post',
            url:'/GoldEggEditData',
            async:true,
            data:$('#form').serialize(),
            dataType:'json',
            success:function(result){
                if(result.code == 100){
                    layer.msg(result.msg,{
                        icon:1,
                        time:1000
                    });
                }
                else{
                    layer.msg(result.msg,{
                        icon:2,
                        time:1000
                    });
                }
            },
            error:function(err){
                layer.msg('服务器开小差了！',{
                    time:1500
                });
            }
        });
    });
    //时间搜索插件
    layui.use('laydate', function () {
        var laydate = layui.laydate;
        lay('.date-search').each(function () {
            laydate.render({
                elem: this,
                type: 'time',
                trigger: 'click'
            });
        });
    });

</script>
</body>

</html>